<template>
	<view>
		<scroll-view style="background-color: #f1f1f1;" scroll-y="true" :lower-threshold="50" @scrolltolower="getData" :style="{'height':Height+'px'}">
			
			<view class="list" v-for="(item,index) in list">
				<view class="list-top">
					<view class="list-top-logo">
						<image :src="$util.img(item.logo)"></image>
					</view>
					<view class="list-top-title">
						{{item.site_name}}
					</view>
				</view>
				<view class="list-main">
					<view class="list-main-list">
						<view class="list-main-number">{{item.numbers}}<text>个</text></view>
						<view class="list-main-content">
							<!-- <view class="list-main-content-icon">
								
							</view> -->
							<!-- <view class=""></view> -->
							合伙人数量
						</view>
					</view>
					<view class="list-main-list">
						<view class="list-main-number">{{item.partner_distribution_rate}}<text>%</text></view>
						<view class="list-main-content">
							<!-- <view class="list-main-content-icon">
								
							</view> -->
							<!-- <view class=""></view> -->
							分红比例
						</view>
					</view>
					<view class="list-main-list">
						<view class="list-main-number">{{item.today_money}}<text>元</text></view>
						<view class="list-main-content">
							<!-- <view class="list-main-content-icon">
								
							</view> -->
							<!-- <view class=""></view> -->
							今日营业额
						</view>
					</view>
					<view class="list-main-list">
						<view class="list-main-number">{{item.yesterday_money}}<text>元</text></view>
						<view class="list-main-content">
							<!-- <view class="list-main-content-icon">
								
							</view> -->
							<!-- <view class=""></view> -->
							昨日营业额
						</view>
					</view>
				</view>
			</view>
			
			<view class="cart-empty" v-if="showEmpty">
				<image :src="$util.img('upload/uniapp/common-empty.png')" mode="aspectFit"></image>
				<view class="color-tip margin-top margin-bottom">暂无数据</view>
				
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				Height:500,
				page:1,
				list:[],
				showEmpty:true,
			}
		},
		methods: {
			onLoad(){
				var that = this;
				
				uni.getSystemInfo({
					success:function(res){
						that.Height = res.windowHeight;
					}
				})
			},
			onShow(){
				this.getData()
			},
			getData(){
				var that = this;
				that.$api.sendRequest({
					url:"/api/Partner/Detail",
					data:{
						page:that.page
					},
					success:function(res){
						
						if(that.page==1){
							if(res.count!=0){
								that.showEmpty = false;
							}
							that.list = res.list;
						}else{
							that.list.push.apply(that.list,res.list);
						}
						if(res.list.length>0){
							that.page++;
						}
					}
				})
			}
		}
	}
</script>

<style>
	.list{
		width: 90%;
		margin: 10px 3%;
		padding: 5px 2%;
		background-color: #fff;
		border-radius: 5px;
	}
	.list-top{
		width: 100%;
		display: flex;
		height: 50px;
		line-height: 50px;
		border-bottom: 1px solid #f0f0f0;
	}
	.list-top-logo image{
		width: 30px;
		height: 30px;
		border-radius: 50%;
		margin:10px 5px;
	}
	.list-top-title{
		flex: 1;
		font-size: 18px;
		line-height: 50px;
		font-weight: 700;
	}
	.list-main{
		width: 100%;
		display: inline-block;
	}
	.list-main-list{
		width: 45%;
		margin: 10px 2.2%;
		float: left;
		text-align: center;
		border: 1px solid #f0f0f0;
		border-radius: 5px;
	}
	.list-main-number{
		font-size: 16px;
		font-weight: 600;
		line-height: 30px;
	}
	.list-main-number text{
		font-weight: 100;
		font-size: 14px;
	}
	.list-main-content{
		color: #333333;
		font-size: 14px;
		line-height: 30px;
	}
	.cart-empty {
		text-align: center;
		padding: 140rpx 80rpx;
	}
	.cart-empty image {
			width: 63%;
			height: 450rpx;
		}
</style>
